<template>
  <el-card style="margin-bottom:20px;">
    <div slot="header" class="clearfix">
      <span> My Introduction</span>
    </div>

    <div class="user-profile">
      <div class="box-center">
        <el-avatar shape="square" :height="'100px'" :width="'100px'" :size="100" :src="user.userAvatar"></el-avatar>
      </div>
      <div class="box-center">
        <div class="user-name text-center">{{ user.userNickname }}</div>
      </div>
    </div>

    <div class="user-bio">
      <div class="user-information user-bio-section">
        <div class="user-bio-section-header">
          <svg-icon icon-class="star" />
          <span>Information</span>
        </div>
        <div class="user-bio-section-body">
          <div class="text-muted">
            <div class="personal-relation">
              <div class="relation-item">
                <div style="float: left; padding-right:20px;">
                  <i class="el-icon-phone"></i>
                  telephone:  {{user.userPhone}}
                </div>
              </div>
            </div>
            <div class="personal-relation">
              <div class="relation-item">
                <div style="float: left; padding-right:20px;">
                  <i class="el-icon-postcard"></i>
                  email：{{user.userEmail}}
                </div>
              </div>
            </div>
            <div class="personal-relation">
              <div class="relation-item">
                <div style="float: left; padding-right:20px;">
                  <i class="el-icon-location-information"></i>
                  userLoginIp：{{user.userLoginIp}}
                </div>
              </div>
            </div>
            <div class="personal-relation">
              <div class="relation-item">
                <div style="float: left; padding-right:20px;">
                  <i class="el-icon-time"></i>
                  userLoginDate： {{user.userLoginDate | dateFormat }}
                </div>
              </div>
            </div>
            <div class="personal-relation">
              <div class="relation-item">
                <div style="float: left; padding-right:20px;">
                  <i class="el-icon-s-promotion"></i>
                  userInfoUpdateTime：{{ user.userInfoUpdateTime |  dateFormat}}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>


      <div class="user-skills user-bio-section">
        <div class="user-bio-section-header">
          <svg-icon icon-class="skill" />
          <span>Skills</span>
        </div>
        <div class="user-bio-section-body">
          <el-tag v-for="item in user.userSkill" :key="item.index">
            {{item}}
          </el-tag>

          <!--          <div class="progress-item">-->
          <!--            <span>Vue</span>-->
          <!--            <el-progress :percentage="70" />-->
          <!--          </div>-->
          <!--          <div class="progress-item">-->
          <!--            <span>JavaScript</span>-->
          <!--            <el-progress :percentage="18" />-->
          <!--          </div>-->
          <!--          <div class="progress-item">-->
          <!--            <span>Css</span>-->
          <!--            <el-progress :percentage="12" />-->
          <!--          </div>-->
          <!--          <div class="progress-item">-->
          <!--            <span>ESLint</span>-->
          <!--            <el-progress :percentage="100" status="success" />-->
          <!--          </div>-->
        </div>
      </div>

      <div class="user-introduction user-bio-section">
        <div class="user-bio-section-header">
          <svg-icon icon-class="education" />
          <span>Introduction</span>
        </div>
        <div class="user-bio-section-body">
          <div class="text-muted">

            <experience />
          </div>
        </div>
      </div>


    </div>
  </el-card>
</template>

<script>
import PanThumb from '@/components/PanThumb'
import SkillTags from "@/views/profile/components/skillTag";
import Experience from "@/views/profile/components/experience";

export default {
  components: {Experience, SkillTags, PanThumb },
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          userId: '',
          userLoginName: '',
          userNickname: '',
          userEmail: '',
          userPhone: '',
          userAvatar: '',
          userPassword: '',
          userStatus: '',
          userLoginIp: '',
          userLoginDate: '',
          userPwdUpdateDate: '',
          userInfoUpdateTime: '',
          userSkill: []
        }
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.box-center {
  margin: 0 auto;
  display: table;
}

.text-muted {
  color: #777;
}

.user-profile {
  .user-name {
    font-weight: bold;
  }

  .box-center {
    padding-top: 10px;
  }

  .user-role {
    padding-top: 10px;
    font-weight: 400;
    font-size: 14px;
  }

  .box-social {
    padding-top: 30px;

    .el-table {
      border-top: 1px solid #dfe6ec;
    }
  }

  .user-follow {
    padding-top: 20px;
  }
}

.user-bio {
  margin-top: 20px;
  color: #606266;

  span {
    padding-left: 4px;
  }

  .user-bio-section {
    font-size: 14px;
    padding: 15px 0;

    .user-bio-section-header {
      border-bottom: 1px solid #dfe6ec;
      padding-bottom: 10px;
      margin-bottom: 10px;
      font-weight: bold;
    }
  }
}
.personal-relation {
  font-size: 16px;
  padding: 0px 5px 15px;
  margin-right: 1px;
  width: 100%
}
.relation-item {
  padding: 3px;
}


</style>
